<?php
function smarty_function_lang($params, &$smarty){
    if(!array_key_exists('m', $params)){
        $smarty->trigger_error('Missing parameter "m" - this should be the module keyname');
        return;
    }
    if(!array_key_exists('l', $params)){
        $smarty->trigger_error('Missing parameter "l" - this should be the label of the value you want to display');
        return;
    }

    $LANG = JFX::registry('lang');

    if(array_key_exists('id', $params)){
        $retVal = $LANG->getContent($params['m'], $params['l'], $params['id']);
    }else{
        $retVal = $LANG->get($params['m'], $params['l']);
    }

    
    return $retVal;

}